home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / appkit / NXImage.h < prev    next >
Text File  |  1992-09-11  |  5KB  |  156 lines

  1. /*
  2.     NXImage.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import <objc/Object.h>
  8. #import "color.h"
  9. #import "graphics.h"
  10. #import "NXImageRep.h"
  11. #import "Pasteboard.h"
  12. #import <objc/List.h>
  13. #import <objc/zone.h>
  14.  
  15. @interface NXImage : Object
  16. {
  17.     char               *name;
  18.     NXSize              _size;
  19.     struct __imageFlags {
  20. #ifdef __BIG_ENDIAN__
  21.     unsigned int        scalable:1;
  22.     unsigned int        dataRetained:1;
  23.     unsigned int        flipDraw:1;
  24.     unsigned int        uniqueWindow:1;
  25.     unsigned int        uniqueWasExplicitlySet:1;
  26.     unsigned int        sizeWasExplicitlySet:1;
  27.     unsigned int        builtIn:1;
  28.     unsigned int        needsToExpand:1;
  29.     unsigned int        useEPSOnResolutionMismatch:1;
  30.     unsigned int        colorMatchPreferred:1;
  31.     unsigned int        multipleResolutionMatching:1;
  32.     unsigned int        dontFreeName:1;
  33.     unsigned int        subImage:1;
  34.     unsigned int        aSynch:1;
  35.     unsigned int        archiveByName:1;
  36.     unsigned int        unboundedCacheDepth:1;
  37. #else
  38.     unsigned int        unboundedCacheDepth:1;
  39.     unsigned int        archiveByName:1;
  40.     unsigned int        aSynch:1;
  41.     unsigned int        subImage:1;
  42.     unsigned int        dontFreeName:1;
  43.     unsigned int        multipleResolutionMatching:1;
  44.     unsigned int        colorMatchPreferred:1;
  45.     unsigned int        useEPSOnResolutionMismatch:1;
  46.     unsigned int        needsToExpand:1;
  47.     unsigned int        builtIn:1;
  48.     unsigned int        sizeWasExplicitlySet:1;
  49.     unsigned int        uniqueWasExplicitlySet:1;
  50.     unsigned int        uniqueWindow:1;
  51.     unsigned int        flipDraw:1;
  52.     unsigned int        dataRetained:1;
  53.     unsigned int        scalable:1;
  54. #endif
  55.     }                   _flags;
  56.     short        _reservedShort;
  57.     void               *_reps;
  58.     List               *_repList;
  59.     NXColor            *_color;
  60.     int            _reservedInt;
  61. }
  62.  
  63. + findImageNamed:(const char *)name;
  64.  
  65. - init;
  66. - initSize:(const NXSize *)aSize;
  67. - initFromFile:(const char *)fileName;
  68. - initFromSection:(const char *)fileName;
  69. - initFromStream:(NXStream *)stream;
  70. - initFromPasteboard:(Pasteboard *)pasteboard;
  71. - initFromImage:(NXImage *)image rect:(const NXRect *)rect;
  72.  
  73. - getImage:(NXImage **)image rect:(NXRect *)rect;
  74. - setSize:(const NXSize *)aSize;
  75. - getSize:(NXSize *)aSize;
  76. - free;
  77. - copyFromZone:(NXZone *)zone;
  78. - (BOOL)setName:(const char *)string;
  79. - (const char *)name;
  80. - setFlipped:(BOOL)flag;
  81. - (BOOL)isFlipped;
  82. - setScalable:(BOOL)flag;
  83. - (BOOL)isScalable;
  84. - setDataRetained:(BOOL)flag;
  85. - (BOOL)isDataRetained;
  86. - setUnique:(BOOL)flag;
  87. - (BOOL)isUnique;
  88. - setCacheDepthBounded:(BOOL)flag;
  89. - (BOOL)isCacheDepthBounded;
  90. - setBackgroundColor:(NXColor)aColor;
  91. - (NXColor)backgroundColor;
  92. - setEPSUsedOnResolutionMismatch:(BOOL)flag;
  93. - (BOOL)isEPSUsedOnResolutionMismatch;
  94. - setColorMatchPreferred:(BOOL)flag;
  95. - (BOOL)isColorMatchPreferred;
  96. - setMatchedOnMultipleResolution:(BOOL)flag;
  97. - (BOOL)isMatchedOnMultipleResolution;
  98. - dissolve:(float)delta toPoint:(const NXPoint *)point;
  99. - dissolve:(float)delta    fromRect:(const NXRect *)rect toPoint:(const NXPoint *)point;
  100. - composite:(int)op toPoint:(const NXPoint *)point;
  101. - composite:(int)op fromRect:(const NXRect *)rect toPoint:(const NXPoint *)point;
  102. - (BOOL)drawRepresentation:(NXImageRep *)imageRep inRect:(const NXRect *)rect;
  103. - recache;
  104. - writeTIFF:(NXStream *)stream;
  105. - writeTIFF:(NXStream *)stream allRepresentations:(BOOL)flag;
  106. - writeTIFF:(NXStream *)stream allRepresentations:(BOOL)flag usingCompression:(int)compression andFactor:(float)aFloat;
  107. - write:(NXTypedStream *)stream;
  108. - read:(NXTypedStream *)stream;
  109. - finishUnarchiving;
  110. - (BOOL)loadFromStream:(NXStream *)stream;
  111. - (BOOL)loadFromFile:(const char *)fileName;
  112. - (BOOL)useFromFile:(const char *)fileName;
  113. - (BOOL)useFromSection:(const char *)fileName;
  114. - (BOOL)useDrawMethod:(SEL)drawMethod inObject:anObject;
  115. - (BOOL)useRepresentation:(NXImageRep *)imageRepresentation;
  116. - (BOOL)useCacheWithDepth:(NXWindowDepth)depth;
  117. - removeRepresentation:(NXImageRep *)imageRepresentation;
  118. - (BOOL)lockFocus;
  119. - (BOOL)lockFocusOn:(NXImageRep *)imageRepresentation;
  120. - unlockFocus;
  121. - (NXImageRep *)lastRepresentation;
  122. - (NXImageRep *)bestRepresentation;
  123. - (List *)representationList;
  124. - setDelegate:(id)anObject;
  125. - delegate;
  126.  
  127.  
  128. + (void)registerImageRep:imageRepClass;
  129. + (void)unregisterImageRep:imageRepClass;
  130. + (Class)imageRepForFileType:(const char *)type;
  131. + (Class)imageRepForPasteboardType:(NXAtom)type;
  132. + (Class)imageRepForStream:(NXStream *)stream;
  133. + (const char *const *)imageUnfilteredFileTypes;
  134. + (const char *const *)imageFileTypes;
  135. + (const NXAtom *)imageUnfilteredPasteboardTypes;
  136. + (const NXAtom *)imagePasteboardTypes;
  137. + (BOOL)canInitFromPasteboard:(Pasteboard *)pasteboard;
  138.  
  139. /* 
  140.  * The following new... methods are now obsolete.  They remain in this  
  141.  * interface file for backward compatibility only.  Use Object's alloc method  
  142.  * and the init... methods defined in this class instead.
  143.  */
  144. + new;
  145. + newSize:(const NXSize *)aSize;
  146. + newFromFile:(const char *)fileName;
  147. + newFromSection:(const char *)fileName;
  148. + newFromStream:(NXStream *)stream;
  149. + newFromImage:(NXImage *)image rect:(const NXRect *)rect;
  150.  
  151. @end
  152.  
  153. @interface Object(NXImageDelegate)
  154. - (NXImage *)imageDidNotDraw:sender inRect:(const NXRect *)aRect;
  155. @end
  156.